/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.smg.community.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.smg.community.model.*;
import com.smg.community.dao.*;
import com.smg.community.service.*;
import com.smg.community.util.StringUtil;
import com.smg.community.vo.query.*;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class SmgMemberBehavior extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "SmgMemberBehavior";
	public static final String ALIAS_BEHAVIOR_ID = "behaviorId";
	public static final String ALIAS_MEMBER_ID = "memberId";
	public static final String ALIAS_HEAD_IMAGE = "headImage";
	public static final String ALIAS_NICK_NAME = "nickName";
	public static final String ALIAS_CONT = "cont";
	public static final String ALIAS_IMAGE = "image";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * behaviorId       db_column: behaviorId 
     */	
	
	private java.lang.Integer behaviorId;
    /**
     * memberId       db_column: memberId 
     */	
	
	private java.lang.Integer memberId;
    /**
     * headImage       db_column: headImage 
     */	
	private java.lang.String headImage;
    /**
     * nickName       db_column: nickName 
     */	
	private java.lang.String nickName;
    /**
     * cont       db_column: cont 
     */	
	private java.lang.String cont;
    /**
     * image       db_column: image 
     */	
	private java.lang.String image;
	//columns END
	
	// 动态类型  1-发帖 2-回帖 3-创建活动 4-参加活动  5-发起投票 6-参加投票   7-加入群组  8-添加好友
	private int type ;
	
	private int fkGroupId;
	
	private String groupName;
	
	private int createMemberId;
	
	private String createMemberName;
	
	private String sourcefrom;
	
	private String url;
	
	private int relatedId ;
	
	private String title;
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getRelatedId() {
		return relatedId;
	}

	public void setRelatedId(int relatedId) {
		this.relatedId = relatedId;
	}

	private String contPreview;
	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getFkGroupId() {
		return fkGroupId;
	}

	public void setFkGroupId(int fkGroupId) {
		this.fkGroupId = fkGroupId;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public int getCreateMemberId() {
		return createMemberId;
	}

	public void setCreateMemberId(int createMemberId) {
		this.createMemberId = createMemberId;
	}

	public String getCreateMemberName() {
		return createMemberName;
	}

	public void setCreateMemberName(String createMemberName) {
		this.createMemberName = createMemberName;
	}

	public String getSourcefrom() {
		return sourcefrom;
	}

	public void setSourcefrom(String sourcefrom) {
		this.sourcefrom = sourcefrom;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getContPreview() {
		return contPreview;
	}

	public void setContPreview(String contPreview) {
		if ( !StringUtil.isEmpty(contPreview)){
			if ( contPreview.length() > 300 ){
				contPreview = contPreview.substring(0,299);
			}
			
		}
		this.contPreview = contPreview;
	}

	public SmgMemberBehavior(){
	}

	public SmgMemberBehavior(
		java.lang.Integer behaviorId
	){
		this.behaviorId = behaviorId;
	}

	public void setBehaviorId(java.lang.Integer value) {
		this.behaviorId = value;
	}
	
	public java.lang.Integer getBehaviorId() {
		return this.behaviorId;
	}
	public void setMemberId(java.lang.Integer value) {
		this.memberId = value;
	}
	
	public java.lang.Integer getMemberId() {
		return this.memberId;
	}
	public void setHeadImage(java.lang.String value) {
		this.headImage = value;
	}
	
	public java.lang.String getHeadImage() {
		return this.headImage;
	}
	public void setNickName(java.lang.String value) {
		this.nickName = value;
	}
	
	public java.lang.String getNickName() {
		return this.nickName;
	}
	public void setCont(java.lang.String value) {
		this.cont = value;
	}
	
	public java.lang.String getCont() {
		return this.cont;
	}
	public void setImage(java.lang.String value) {
		this.image = value;
	}
	
	public java.lang.String getImage() {
		if ( image == null){
			return  "http://img3.ddmapimg.com/crm//2013-05-14/233656344.jpg";
		}
		return this.image;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("BehaviorId",getBehaviorId())
			.append("MemberId",getMemberId())
			.append("HeadImage",getHeadImage())
			.append("NickName",getNickName())
			.append("Cont",getCont())
			.append("Image",getImage())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getBehaviorId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SmgMemberBehavior == false) return false;
		if(this == obj) return true;
		SmgMemberBehavior other = (SmgMemberBehavior)obj;
		return new EqualsBuilder()
			.append(getBehaviorId(),other.getBehaviorId())
			.isEquals();
	}
}

